<template>
  <div>
    <FilterTable
      ref="table"
      :columns="columns"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :datakey="'rows'"
      :onColumnsChange="columns => (this.columns = columns)"
      columnsRef="partInventoryManagerAttachUpdateAttachUpdateItem"
      :isSelectColumn="false"
    ></FilterTable>
    <!-- <div
      style="position: absolute;left: 0;bottom: 0;right: 0;z-index: 9;border-top: 1px solid rgb(233, 233, 233);padding: 10px 20px;background: rgb(255, 255, 255);text-align: right;"
    >-->
    <div class="bottombtnwrap">
      <el-button @click="closeHandler">关闭</el-button>
    </div>
  </div>
</template>

<script>
import { getSapPartLogList, getSapPartLogItemList } from '@/api/part/inventoryManager/attachUpdate';
export default {
  name: 'attachUpdateItem',
  props: {
    partNo: String
  },
  data() {
    return {
      columns: this.createTableColumnst(),
      fetchApi: getSapPartLogItemList,
      fetchParams: { xhrAbort: false, partNo: this.partNo }
    };
  },
  created() {
    this.initialVal();
  },
  methods: {
    closeHandler() {
      this.$emit('close');
    },
    initialVal() {
      // console.log(this.partNo, 'partNO');
    },
    createTableColumnst() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 100,
          sorter: true,
          // filter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '配件代码',
          dataIndex: 'matnr',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '更新状态(I:新件 D:删除)',
          dataIndex: 'zgxbs',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '更新日期',
          dataIndex: 'updateDate',
          width: 150,
          dateFormat: 'yyyy-MM-dd',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          editable: true,
          editType: 'date-picker'
        },
        {
          title: '更新时间',
          dataIndex: 'updateTime',
          width: 150,
          dateFormat: 'yyyy-MM-dd',
          sorter: true,
          filter: true,
          filterType: 'date-range',
          editable: true,
          editType: 'date-picker'
        }
      ];
    }
  }
};
</script>

<style scoped>
.bottombtnwrap {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 9;
  border-top: 1px solid rgb(233, 233, 233);
  padding: 10px 20px;
  background: rgb(255, 255, 255);
  text-align: right;
}
</style>
